package com.mt.mtyx.product;

import com.mt.mtyx.entity.product.Category;
import com.mt.mtyx.entity.product.SkuInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 商品 远程调用服务
 *
 * @author WMT
 * @Date 2023/7/21 18:06
 */
@FeignClient(value = "service-product")
public interface ProductFeignClient {

    @GetMapping("/api/product/inner/getCategoryById/{categoryById}")
    Category getCategoryById(@PathVariable("categoryById") Long categoryById);

    @GetMapping("/api/product/inner/getSkuInfoById/{skuId}")
    SkuInfo getSkuInfoById(@PathVariable("skuId") Long id);

    @PostMapping("/api/product/inner/getSkuInfoList")
    List<SkuInfo> getSkuInfoListByIds(@RequestBody List<Long> ids);

    @GetMapping("/api/product/inner/getSkuInfoListByKeyword/{keyword}")
    List<SkuInfo> getSkuInfoListByKeyword(@PathVariable("keyword") String keyword);

    @PostMapping("/api/product/inner/getCategoryList")
    List<Category> getCategoryListByIds(List<Long> rangeIds);

    @GetMapping("/api/product/inner/getAllCategoryList")
    List<Category> getAllCategoryList();

    @GetMapping("/api/product/inner/getNewPersonSkuInfoList")
    List<SkuInfo> getNewPersonSkuInfoList();
}
